<%--
  Created by IntelliJ IDEA.
  User: 86181
  Date: 2022/11/2
  Time: 22:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>安全库存配置单</title>
    <style>
        tr{
            padding-t: 10px;
        }
    </style>
</head>
<body>
        <form id="CellStockstatus">
        <div class="modal-header">
                <input type="submit" class="btn btn-default" value="复核">
                <button class="close" data-dismiss="modal">退出</button>
            <input type="text" id="cellcheckupdateid" style="display: none" name="id">
        </div>
        <div class="modal-body" align="center">
            <h2 class="modal-title">安全库存配置单</h2>
            <div class="row" style="margin-top:30px">
                <div class="col-md-6">
                    <table>
                        <tr>
                            <td>配置单编号:</td>
                            <td><input type="text" id="storeIdzhdc" name="storeId" style="outline: none;border: none" readonly></td>
                        </tr>
                        <tr>
                            <td>产品名称:</td>
                            <td><input type="text" id="productNamezhdc" name="productName" style="outline: none;border: none" readonly></td>
                        </tr>
                        <tr>
                            <td>库存报警下线数:</td>
                            <td><input type="text" id="minAmountzhdc" required name="minAmount" style="outline: none;border:none;border-bottom:black 1px dashed"></td>
                        </tr>
                    </table>
                    <br><br>
                </div>
                <div class="col-md-6">
                    <table>
                        <tr>
                            <td>产品编号:</td>
                            <td><input type="text" name="productId" id="productIdzhdc" style="outline: none;border: none" readonly></td>
                        </tr>
                        <tr>
                            <td>库存报警上限数:</td>
                            <td><input type="text" name="maxAmount" id="maxAmountzhdc" required style="outline: none;border:none;border-bottom:black 1px dashed"></td>
                        </tr>
                        <tr>
                            <td>设计人:</td>
                            <td><input type="text" id="registerzhdc" name="register" required style="outline: none;border:none;border-bottom:black 1px dashed"></td>
                        </tr>
                    </table>
                </div>
                <div>
                    <table class="table  table-responsive table-condensed table-bordered table-striped">
                        <tr style="background-color: #2aabd2">
                            <td>库房名称</td>
                            <td>存储地址编号</td>
                            <td>存储地址名称</td>
                            <td>存储单元简称</td>
                            <td>最大存储量</td>
                            <td>存储单位</td>
                        </tr>
                        <tr>
                            <td><input type="text"  value="成品库" style="outline: none;border: none;width:80px" readonly ></td>
                            <td><input type="text"  value="01-01-01" style="outline: none;border: none;width:70px" readonly ></td>
                            <td><input type="text"  name="stackdzhd" id="stackdzhd" style="outline: none;border: none;width:160px " readonly ></td>
                            <td><input type="text" value="件" style="outline: none;border:none;width:80px"></td>
                            <td><input type="text" required name="maxCapacityAmount" id="maxCapacityAmountzhdc" style="outline: none;border:none;width:80px"></td>
                            <td><input type="text" value="g" style="outline: none;border:none;width:80px"></td>
                        </tr>
                    </table>
                </div>

                <br><br>
                <div class="row">
                    <div class="col-md-6">
                        <table>
                            <tr>
                                <td>复核人:</td>
                                <td><input type="text" value="${username}" name="checker"  style="outline: none;border:none;border-bottom:black 1px dashed"></td>
                            </tr>
                        </table>
                    </div>
                    <div class="col-md-6">
                        <table>
                            <tr>
                                <td>登记时间:</td>
                                <td><input type="text" name="registerTime" id="registerTimezhdc" style="outline: none;border:none" readonly></td>
                            </tr>
                        </table>
                    </div>
                </div>
                <br><br>
                <div>
                    <div class="form-group">
                        <label for="message-text" class="control-label">配置要求:</label>
                        <textarea class="form-control" name="config" id="message-text" style="width:800px;height:200px"></textarea>
                    </div>
                </div>
            </div>
        </div>
        </form>
        <script>
            //加载数据
            $(function () {
                var datetimestack;
                //点击获取当前时间
                $.get("queryCellByDate.action",function (data) {
                    datetimestack=data.datetime;
                },"json")
                //获取id
                var id='${param.id}'
                $("#cellcheckupdateid").val(id)
                //根据账号查询产品
                $.post("queryByCellIdcheck.action/"+id,function (data) {
                    console.log(data)
                    $("#storeIdzhdc").val(data.storeId)
                    $("#minAmountzhdc").val(data.minAmount)
                    $("#productNamezhdc").val(data.productName)
                    $("#productIdzhdc").val(data.productId);
                    $("#maxAmountzhdc").val(data.maxAmount)
                    $("#registerzhdc").val(data.register)
                    var firstkindname=data.firstKindName;
                    var secondkindname=data.secondKindName;
                    var thirdkindname=data.thirdKindName;

                    $("#stackdzhd").val(firstkindname+"-"+secondkindname+"-"+thirdkindname);
                    $("#registerTimezhdc").val(datetimestack)
                    $("#message-text").val(data.config)
                    $("#maxCapacityAmountzhdc").val(data.maxCapacityAmount)
                },"json")
            })
            //提交

           $(function () {
                $("#CellStockstatus").validate({
                    submitHandler:function () {
                        $("#CellStockstatus").ajaxSubmit({
                            url:"queryByCekkUpdatestatus.action",
                            type:"post",
                            dataType:"json",
                            success: function (data) {
                                alert(data.msg)
                                $("#cellchckmodal").modal("hide")
                                $("#cellchecktab").bootstrapTable("refresh")
                            }
                        })
                    }
                })
            })

        </script>
</body>
</html>
